# Contributor: Alan Lacerda <alacerda@alpinelinux.org>
# Maintainer: Alan Lacerda <alacerda@alpinelinux.org>
pkgname=darkhttpd
pkgver=1.13
pkgrel=0
pkgdesc="A simple, single-threaded, static content webserver"
url="https://unix4lyfe.org/darkhttpd/"
arch="all"
license="ISC"
options="!check" # no tests
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="darkhttpd-$pkgver.tar.gz::https://github.com/emikulic/darkhttpd/archive/v$pkgver.tar.gz
	darkhttpd.logrotate
	darkhttpd.initd
	darkhttpd.confd
	"

build() {
	make
}

package() {
	install -Dm755 darkhttpd "$pkgdir"/usr/bin/darkhttpd
	install -d "$pkgdir"/var/www/localhost/htdocs \
		"$pkgdir"/var/log/darkhttpd

	install -Dm755 "$srcdir"/darkhttpd.initd "$pkgdir"/etc/init.d/darkhttpd
	install -Dm644 "$srcdir"/darkhttpd.confd "$pkgdir"/etc/conf.d/darkhttpd
}

sha512sums="2c8c5dd225f3ba8b636adeae049039b5c3f852b3efe17969075cd361c34f7bfbef9efa6d64a0a9c6021fae939d85befe92981923e1fa3d326c8a8402f3358868  darkhttpd-1.13.tar.gz
bb95277a9f8f227aeec8bfe6ef54f52a2f034ed0dd25258b996c17f9ce9dd4ad220366b10490246b25bb6b18ccde7bda0d52eeb88667941cf2fdab15c940dbbc  darkhttpd.logrotate
dd792892588e03cef4a36bb8e81297990884298d8a2bc1c14ae2d8986a0a17af8d15bf3fb4e1830d22b154dc00591d884e20da915f51fd8ecf3b05b6c92dc7d4  darkhttpd.initd
79ecdbc751e8b5497a1afee294cf0addb4261f041a58a382e7fb51dd698dd99625a369173542c905e1e4eac7c68dfa1d8d778f4777ebe74d5031817a6ec437ad  darkhttpd.confd"
